package com.elminster.entity.base;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * User entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "user", catalog = "test")
public class User extends AbstractUser implements java.io.Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -2718435316281663226L;
    
    private List<Detail> details;
    
    // Constructors
    /** default constructor */
    public User() {
    }

    /** full constructor */
    public User(String name) {
        super(name);
    }

    @OneToMany(mappedBy = "ownerId", fetch = FetchType.EAGER)
    public List<Detail> getDetails() {
        return details;
    }

    public void setDetails(List<Detail> details) {
        this.details = details;
    }
    
    public String toString() {
        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
    }
}
